/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tcloudclient.settings;

import api.Beans.UserLogin;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.File;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Tomas
 */
@XmlRootElement
public class ApplicationSettings {
    
    public static final String PROP_CONNECT_SETTINGS = "connectSettingsS";
    
    private File registerDir;
    private UserLogin user;
    private int AccHeaderVetsion;
    protected ConnectSettings connectSettings;
    

    /**
     * Get the value of connectSettingsS
     *
     * @return the value of connectSettingsS
     */
    public ConnectSettings getConnectSettings() {
        return connectSettings;
    }

    /**
     * Set the value of connectSettingsS
     *
     * @param connectSettingsS new value of connectSettingsS
     */
    public void setConnectSettings(ConnectSettings connectSettings) {
        ConnectSettings oldConnectSettings = this.connectSettings;
        this.connectSettings = connectSettings;
        propertyChangeSupport.firePropertyChange(PROP_CONNECT_SETTINGS, oldConnectSettings, connectSettings);
    }
    private transient final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

    /**
     * Add PropertyChangeListener.
     *
     * @param listener
     */
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.addPropertyChangeListener(listener);
    }

    /**
     * Remove PropertyChangeListener.
     *
     * @param listener
     */
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.removePropertyChangeListener(listener);
    }


    public File getRegisterDir() {
        return registerDir;
    }

    public void setRegisterDir(File registerDir) {
        this.registerDir = registerDir;
    }
    
    public boolean isRegistredDir(){
        return registerDir != null;
    }

    public Long getUserId() {
        return user.getUserId();
    }

    public void setUser(UserLogin user) {
        this.user = user;
    }

    public UserLogin getUser() {
        return user;
    }
    
    public int getAccHeaderVetsion() {
        return AccHeaderVetsion;
    }

    public void setAccHeaderVetsion(int AccHeaderVetsion) {
        this.AccHeaderVetsion = AccHeaderVetsion;
    }
       
}
